



<!DOCTYPE html>
<html>
<head>
 <link rel="icon" type="image/vnd.microsoft.icon" href="http://www.gstatic.com/codesite/ph/images/phosting.ico">
 
 
 <script type="text/javascript">
 
 
 
 
 var codesite_token = "dfc4e5b271ba67012ad3c69be7727c05";
 
 
 var CS_env = {"token":"dfc4e5b271ba67012ad3c69be7727c05","assetHostPath":"http://www.gstatic.com/codesite/ph","domainName":null,"assetVersionPath":"http://www.gstatic.com/codesite/ph/7955777679655757817","projectName":"earth-api-samples","projectHomeUrl":"/p/earth-api-samples","absoluteBaseUrl":"http://code.google.com","relativeBaseUrl":"","urlPrefix":"p","loggedInUserEmail":"luuisabelle@gmail.com"};
 </script>
 
 
 <title>index.html - 
 earth-api-samples -
 
 
 Official Google Earth API samples and Earth API Issue Tracker - Google Project Hosting
 </title>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
 
 <meta name="ROBOTS" content="NOARCHIVE">
 
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/7955777679655757817/css/ph_core.css">
 
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/7955777679655757817/css/ph_detail.css" >
 
 
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/7955777679655757817/css/d_sb.css" >
 
 
 
<!--[if IE]>
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/7955777679655757817/css/d_ie.css" >
<![endif]-->
 <style type="text/css">
 .menuIcon.off { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 -42px }
 .menuIcon.on { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 -28px }
 .menuIcon.down { background: no-repeat url(http://www.gstatic.com/codesite/ph/images/dropdown_sprite.gif) 0 0; }
 
 
 
  tr.inline_comment {
 background: #fff;
 vertical-align: top;
 }
 div.draft, div.published {
 padding: .3em;
 border: 1px solid #999; 
 margin-bottom: .1em;
 font-family: arial, sans-serif;
 max-width: 60em;
 }
 div.draft {
 background: #ffa;
 } 
 div.published {
 background: #e5ecf9;
 }
 div.published .body, div.draft .body {
 padding: .5em .1em .1em .1em;
 max-width: 60em;
 white-space: pre-wrap;
 white-space: -moz-pre-wrap;
 white-space: -pre-wrap;
 white-space: -o-pre-wrap;
 word-wrap: break-word;
 font-size: 1em;
 }
 div.draft .actions {
 margin-left: 1em;
 font-size: 90%;
 }
 div.draft form {
 padding: .5em .5em .5em 0;
 }
 div.draft textarea, div.published textarea {
 width: 95%;
 height: 10em;
 font-family: arial, sans-serif;
 margin-bottom: .5em;
 }

 
 .nocursor, .nocursor td, .cursor_hidden, .cursor_hidden td {
 background-color: white;
 height: 2px;
 }
 .cursor, .cursor td {
 background-color: darkblue;
 height: 2px;
 display: '';
 }
 
 
.list {
 border: 1px solid white;
 border-bottom: 0;
}

 </style>
</head>
<body class="t4">
 <script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(
 ['siteTracker._setAccount', 'UA-18071-1'],
 ['siteTracker._trackPageview']);
 
 _gaq.push(
 ['projectTracker._setAccount', 'UA-12846745-8'],
 ['projectTracker._trackPageview']);
 
 (function() {
 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
 })();
 </script>
<div class="headbg">
 <div id="gaia">
 

 <span>
 
 
 <b>luuisabelle@gmail.com</b>
 
 
 | <a href="/u/@VBRTRF1TAhdNWwR%2F/" id="projects-dropdown" onclick="return false;"
 ><u>My favorites</u> <small>&#9660;</small></a>
 | <a href="/u/@VBRTRF1TAhdNWwR%2F/" onclick="_CS_click('/gb/ph/profile');" 
 title="Profile, Updates, and Settings"
 ><u>Profile</u></a>
 | <a href="https://www.google.com/accounts/Logout?continue=http%3A%2F%2Fcode.google.com%2Fp%2Fearth-api-samples%2Fsource%2Fbrowse%2Ftrunk%2Fdemos%2Fdom-tree%2Findex.html" 
 onclick="_CS_click('/gb/ph/signout');"
 ><u>Sign out</u></a>
 
 </span>

 </div>
 <div class="gbh" style="left: 0pt;"></div>
 <div class="gbh" style="right: 0pt;"></div>
 
 
 <div style="height: 1px"></div>
<!--[if lte IE 7]>
<div style="text-align:center;">
Your version of Internet Explorer is not supported. Try a browser that
contributes to open source, such as <a href="http://www.firefox.com">Firefox</a>,
<a href="http://www.google.com/chrome">Google Chrome</a>, or
<a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a>.
</div>
<![endif]-->




 <table style="padding:0px; margin: 0px 0px 10px 0px; width:100%" cellpadding="0" cellspacing="0">
 <tr style="height: 58px;">
 
 <td id="plogo">
 <a href="/p/earth-api-samples/">
 
 
 <img src="/p/earth-api-samples/logo?cct=1301082768" alt="Logo">
 
 </a>
 </td>
 
 <td style="padding-left: 0.5em">
 
 <div id="pname">
 <a href="/p/earth-api-samples/">earth-api-samples</a>
 </div>
 
 <div id="psum">
 <a id="project_summary_link" href="/p/earth-api-samples/" >Official Google Earth API samples and Earth API Issue Tracker</a>
 
 </div>
 
 
 </td>
 <td style="white-space:nowrap;text-align:right; vertical-align:bottom;">
 
 <form action="/hosting/search">
 <input size="30" name="q" value="" type="text">
 <input type="submit" name="projectsearch" value="Search projects" >
 </form>
 
 </tr>
 </table>

</div>

 
<div id="mt" class="gtb"> 
 <a href="/p/earth-api-samples/" class="tab ">Project&nbsp;Home</a>
 
 
 
 
 <a href="/p/earth-api-samples/downloads/list" class="tab ">Downloads</a>
 
 
 
 
 
 
 
 <a href="/p/earth-api-samples/issues/list"
 class="tab ">Issues</a>
 
 
 
 
 
 <a href="/p/earth-api-samples/source/checkout"
 class="tab active">Source</a>
 
 
 
 
 
 <div class=gtbc></div>
</div>
<table cellspacing="0" cellpadding="0" width="100%" align="center" border="0" class="st">
 <tr>
 
 
 
 
 
 
 <td class="subt">
 <div class="st2">
 <div class="isf">
 
 
 
 <span class="inst1"><a href="/p/earth-api-samples/source/checkout">Checkout</a></span> &nbsp;
 <span class="inst2"><a href="/p/earth-api-samples/source/browse/trunk">Browse</a></span> &nbsp;
 <span class="inst3"><a href="/p/earth-api-samples/source/list">Changes</a></span> &nbsp;
 
 <form action="http://www.google.com/codesearch" method="get" style="display:inline"
 onsubmit="document.getElementById('codesearchq').value = document.getElementById('origq').value + ' package:http://earth-api-samples\\.googlecode\\.com'">
 <input type="hidden" name="q" id="codesearchq" value="">
 <input type="text" maxlength="2048" size="38" id="origq" name="origq" value="" title="Google Code Search" style="font-size:92%">&nbsp;<input type="submit" value="Search Trunk" name="btnG" style="font-size:92%">
 
 
 
 </form>
 </div>
</div>

 </td>
 
 
 
 <td align="right" valign="top" class="bevel-right"></td>
 </tr>
</table>


<script type="text/javascript">
 var cancelBubble = false;
 function _go(url) { document.location = url; }
</script>
<div id="maincol"
 
>

 
<!-- IE -->




<div class="expand">
<div id="colcontrol">
<style type="text/css">
 #file_flipper { white-space: nowrap; padding-right: 2em; }
 #file_flipper.hidden { display: none; }
 #file_flipper .pagelink { color: #0000CC; text-decoration: underline; }
 #file_flipper #visiblefiles { padding-left: 0.5em; padding-right: 0.5em; }
</style>
<table id="nav_and_rev" class="list"
 cellpadding="0" cellspacing="0" width="100%">
 <tr>
 
 <td nowrap="nowrap" class="src_crumbs src_nav" width="33%">
 <strong class="src_nav">Source path:&nbsp;</strong>
 <span id="crumb_root">
 
 <a href="/p/earth-api-samples/source/browse/">svn</a>/&nbsp;</span>
 <span id="crumb_links" class="ifClosed"><a href="/p/earth-api-samples/source/browse/trunk/">trunk</a><span class="sp">/&nbsp;</span><a href="/p/earth-api-samples/source/browse/trunk/demos/">demos</a><span class="sp">/&nbsp;</span><a href="/p/earth-api-samples/source/browse/trunk/demos/dom-tree/">dom-tree</a><span class="sp">/&nbsp;</span>index.html</span>
 
 

 </td>
 
 
 <td nowrap="nowrap" width="33%" align="center">
 <a href="/p/earth-api-samples/source/browse/trunk/demos/dom-tree/index.html?edit=1"
 ><img src="http://www.gstatic.com/codesite/ph/images/pencil-y14.png"
 class="edit_icon">Edit file</a>
 </td>
 
 
 <td nowrap="nowrap" width="33%" align="right">
 <table cellpadding="0" cellspacing="0" style="font-size: 100%"><tr>
 
 
 <td class="flipper">
 <ul class="leftside">
 
 <li><a href="/p/earth-api-samples/source/browse/trunk/demos/dom-tree/index.html?r=56" title="Previous">&lsaquo;r56</a></li>
 
 </ul>
 </td>
 
 <td class="flipper"><b>r121</b></td>
 
 </tr></table>
 </td> 
 </tr>
</table>

<div class="fc">
 
 
 
<style type="text/css">
.undermouse span {
 background-image: url(http://www.gstatic.com/codesite/ph/images/comments.gif); }
</style>
<table class="opened" id="review_comment_area"
><tr>
<td id="nums">
<pre><table width="100%"><tr class="nocursor"><td></td></tr></table></pre>
<pre><table width="100%" id="nums_table_0"><tr id="gr_svn121_1"

><td id="1"><a href="#1">1</a></td></tr
><tr id="gr_svn121_2"

><td id="2"><a href="#2">2</a></td></tr
><tr id="gr_svn121_3"

><td id="3"><a href="#3">3</a></td></tr
><tr id="gr_svn121_4"

><td id="4"><a href="#4">4</a></td></tr
><tr id="gr_svn121_5"

><td id="5"><a href="#5">5</a></td></tr
><tr id="gr_svn121_6"

><td id="6"><a href="#6">6</a></td></tr
><tr id="gr_svn121_7"

><td id="7"><a href="#7">7</a></td></tr
><tr id="gr_svn121_8"

><td id="8"><a href="#8">8</a></td></tr
><tr id="gr_svn121_9"

><td id="9"><a href="#9">9</a></td></tr
><tr id="gr_svn121_10"

><td id="10"><a href="#10">10</a></td></tr
><tr id="gr_svn121_11"

><td id="11"><a href="#11">11</a></td></tr
><tr id="gr_svn121_12"

><td id="12"><a href="#12">12</a></td></tr
><tr id="gr_svn121_13"

><td id="13"><a href="#13">13</a></td></tr
><tr id="gr_svn121_14"

><td id="14"><a href="#14">14</a></td></tr
><tr id="gr_svn121_15"

><td id="15"><a href="#15">15</a></td></tr
><tr id="gr_svn121_16"

><td id="16"><a href="#16">16</a></td></tr
><tr id="gr_svn121_17"

><td id="17"><a href="#17">17</a></td></tr
><tr id="gr_svn121_18"

><td id="18"><a href="#18">18</a></td></tr
><tr id="gr_svn121_19"

><td id="19"><a href="#19">19</a></td></tr
><tr id="gr_svn121_20"

><td id="20"><a href="#20">20</a></td></tr
><tr id="gr_svn121_21"

><td id="21"><a href="#21">21</a></td></tr
><tr id="gr_svn121_22"

><td id="22"><a href="#22">22</a></td></tr
><tr id="gr_svn121_23"

><td id="23"><a href="#23">23</a></td></tr
><tr id="gr_svn121_24"

><td id="24"><a href="#24">24</a></td></tr
><tr id="gr_svn121_25"

><td id="25"><a href="#25">25</a></td></tr
><tr id="gr_svn121_26"

><td id="26"><a href="#26">26</a></td></tr
><tr id="gr_svn121_27"

><td id="27"><a href="#27">27</a></td></tr
><tr id="gr_svn121_28"

><td id="28"><a href="#28">28</a></td></tr
><tr id="gr_svn121_29"

><td id="29"><a href="#29">29</a></td></tr
><tr id="gr_svn121_30"

><td id="30"><a href="#30">30</a></td></tr
><tr id="gr_svn121_31"

><td id="31"><a href="#31">31</a></td></tr
><tr id="gr_svn121_32"

><td id="32"><a href="#32">32</a></td></tr
><tr id="gr_svn121_33"

><td id="33"><a href="#33">33</a></td></tr
><tr id="gr_svn121_34"

><td id="34"><a href="#34">34</a></td></tr
><tr id="gr_svn121_35"

><td id="35"><a href="#35">35</a></td></tr
><tr id="gr_svn121_36"

><td id="36"><a href="#36">36</a></td></tr
><tr id="gr_svn121_37"

><td id="37"><a href="#37">37</a></td></tr
><tr id="gr_svn121_38"

><td id="38"><a href="#38">38</a></td></tr
><tr id="gr_svn121_39"

><td id="39"><a href="#39">39</a></td></tr
><tr id="gr_svn121_40"

><td id="40"><a href="#40">40</a></td></tr
><tr id="gr_svn121_41"

><td id="41"><a href="#41">41</a></td></tr
><tr id="gr_svn121_42"

><td id="42"><a href="#42">42</a></td></tr
><tr id="gr_svn121_43"

><td id="43"><a href="#43">43</a></td></tr
><tr id="gr_svn121_44"

><td id="44"><a href="#44">44</a></td></tr
><tr id="gr_svn121_45"

><td id="45"><a href="#45">45</a></td></tr
><tr id="gr_svn121_46"

><td id="46"><a href="#46">46</a></td></tr
><tr id="gr_svn121_47"

><td id="47"><a href="#47">47</a></td></tr
><tr id="gr_svn121_48"

><td id="48"><a href="#48">48</a></td></tr
><tr id="gr_svn121_49"

><td id="49"><a href="#49">49</a></td></tr
><tr id="gr_svn121_50"

><td id="50"><a href="#50">50</a></td></tr
><tr id="gr_svn121_51"

><td id="51"><a href="#51">51</a></td></tr
><tr id="gr_svn121_52"

><td id="52"><a href="#52">52</a></td></tr
><tr id="gr_svn121_53"

><td id="53"><a href="#53">53</a></td></tr
><tr id="gr_svn121_54"

><td id="54"><a href="#54">54</a></td></tr
><tr id="gr_svn121_55"

><td id="55"><a href="#55">55</a></td></tr
><tr id="gr_svn121_56"

><td id="56"><a href="#56">56</a></td></tr
><tr id="gr_svn121_57"

><td id="57"><a href="#57">57</a></td></tr
><tr id="gr_svn121_58"

><td id="58"><a href="#58">58</a></td></tr
><tr id="gr_svn121_59"

><td id="59"><a href="#59">59</a></td></tr
><tr id="gr_svn121_60"

><td id="60"><a href="#60">60</a></td></tr
><tr id="gr_svn121_61"

><td id="61"><a href="#61">61</a></td></tr
><tr id="gr_svn121_62"

><td id="62"><a href="#62">62</a></td></tr
><tr id="gr_svn121_63"

><td id="63"><a href="#63">63</a></td></tr
><tr id="gr_svn121_64"

><td id="64"><a href="#64">64</a></td></tr
><tr id="gr_svn121_65"

><td id="65"><a href="#65">65</a></td></tr
><tr id="gr_svn121_66"

><td id="66"><a href="#66">66</a></td></tr
><tr id="gr_svn121_67"

><td id="67"><a href="#67">67</a></td></tr
><tr id="gr_svn121_68"

><td id="68"><a href="#68">68</a></td></tr
><tr id="gr_svn121_69"

><td id="69"><a href="#69">69</a></td></tr
><tr id="gr_svn121_70"

><td id="70"><a href="#70">70</a></td></tr
><tr id="gr_svn121_71"

><td id="71"><a href="#71">71</a></td></tr
><tr id="gr_svn121_72"

><td id="72"><a href="#72">72</a></td></tr
><tr id="gr_svn121_73"

><td id="73"><a href="#73">73</a></td></tr
><tr id="gr_svn121_74"

><td id="74"><a href="#74">74</a></td></tr
><tr id="gr_svn121_75"

><td id="75"><a href="#75">75</a></td></tr
><tr id="gr_svn121_76"

><td id="76"><a href="#76">76</a></td></tr
><tr id="gr_svn121_77"

><td id="77"><a href="#77">77</a></td></tr
><tr id="gr_svn121_78"

><td id="78"><a href="#78">78</a></td></tr
><tr id="gr_svn121_79"

><td id="79"><a href="#79">79</a></td></tr
><tr id="gr_svn121_80"

><td id="80"><a href="#80">80</a></td></tr
><tr id="gr_svn121_81"

><td id="81"><a href="#81">81</a></td></tr
><tr id="gr_svn121_82"

><td id="82"><a href="#82">82</a></td></tr
><tr id="gr_svn121_83"

><td id="83"><a href="#83">83</a></td></tr
><tr id="gr_svn121_84"

><td id="84"><a href="#84">84</a></td></tr
><tr id="gr_svn121_85"

><td id="85"><a href="#85">85</a></td></tr
><tr id="gr_svn121_86"

><td id="86"><a href="#86">86</a></td></tr
><tr id="gr_svn121_87"

><td id="87"><a href="#87">87</a></td></tr
><tr id="gr_svn121_88"

><td id="88"><a href="#88">88</a></td></tr
><tr id="gr_svn121_89"

><td id="89"><a href="#89">89</a></td></tr
><tr id="gr_svn121_90"

><td id="90"><a href="#90">90</a></td></tr
><tr id="gr_svn121_91"

><td id="91"><a href="#91">91</a></td></tr
><tr id="gr_svn121_92"

><td id="92"><a href="#92">92</a></td></tr
><tr id="gr_svn121_93"

><td id="93"><a href="#93">93</a></td></tr
><tr id="gr_svn121_94"

><td id="94"><a href="#94">94</a></td></tr
><tr id="gr_svn121_95"

><td id="95"><a href="#95">95</a></td></tr
><tr id="gr_svn121_96"

><td id="96"><a href="#96">96</a></td></tr
><tr id="gr_svn121_97"

><td id="97"><a href="#97">97</a></td></tr
><tr id="gr_svn121_98"

><td id="98"><a href="#98">98</a></td></tr
><tr id="gr_svn121_99"

><td id="99"><a href="#99">99</a></td></tr
><tr id="gr_svn121_100"

><td id="100"><a href="#100">100</a></td></tr
><tr id="gr_svn121_101"

><td id="101"><a href="#101">101</a></td></tr
><tr id="gr_svn121_102"

><td id="102"><a href="#102">102</a></td></tr
><tr id="gr_svn121_103"

><td id="103"><a href="#103">103</a></td></tr
><tr id="gr_svn121_104"

><td id="104"><a href="#104">104</a></td></tr
><tr id="gr_svn121_105"

><td id="105"><a href="#105">105</a></td></tr
><tr id="gr_svn121_106"

><td id="106"><a href="#106">106</a></td></tr
><tr id="gr_svn121_107"

><td id="107"><a href="#107">107</a></td></tr
><tr id="gr_svn121_108"

><td id="108"><a href="#108">108</a></td></tr
><tr id="gr_svn121_109"

><td id="109"><a href="#109">109</a></td></tr
><tr id="gr_svn121_110"

><td id="110"><a href="#110">110</a></td></tr
><tr id="gr_svn121_111"

><td id="111"><a href="#111">111</a></td></tr
><tr id="gr_svn121_112"

><td id="112"><a href="#112">112</a></td></tr
><tr id="gr_svn121_113"

><td id="113"><a href="#113">113</a></td></tr
><tr id="gr_svn121_114"

><td id="114"><a href="#114">114</a></td></tr
><tr id="gr_svn121_115"

><td id="115"><a href="#115">115</a></td></tr
><tr id="gr_svn121_116"

><td id="116"><a href="#116">116</a></td></tr
><tr id="gr_svn121_117"

><td id="117"><a href="#117">117</a></td></tr
><tr id="gr_svn121_118"

><td id="118"><a href="#118">118</a></td></tr
><tr id="gr_svn121_119"

><td id="119"><a href="#119">119</a></td></tr
><tr id="gr_svn121_120"

><td id="120"><a href="#120">120</a></td></tr
><tr id="gr_svn121_121"

><td id="121"><a href="#121">121</a></td></tr
><tr id="gr_svn121_122"

><td id="122"><a href="#122">122</a></td></tr
><tr id="gr_svn121_123"

><td id="123"><a href="#123">123</a></td></tr
><tr id="gr_svn121_124"

><td id="124"><a href="#124">124</a></td></tr
><tr id="gr_svn121_125"

><td id="125"><a href="#125">125</a></td></tr
><tr id="gr_svn121_126"

><td id="126"><a href="#126">126</a></td></tr
><tr id="gr_svn121_127"

><td id="127"><a href="#127">127</a></td></tr
><tr id="gr_svn121_128"

><td id="128"><a href="#128">128</a></td></tr
><tr id="gr_svn121_129"

><td id="129"><a href="#129">129</a></td></tr
><tr id="gr_svn121_130"

><td id="130"><a href="#130">130</a></td></tr
><tr id="gr_svn121_131"

><td id="131"><a href="#131">131</a></td></tr
><tr id="gr_svn121_132"

><td id="132"><a href="#132">132</a></td></tr
><tr id="gr_svn121_133"

><td id="133"><a href="#133">133</a></td></tr
><tr id="gr_svn121_134"

><td id="134"><a href="#134">134</a></td></tr
><tr id="gr_svn121_135"

><td id="135"><a href="#135">135</a></td></tr
><tr id="gr_svn121_136"

><td id="136"><a href="#136">136</a></td></tr
><tr id="gr_svn121_137"

><td id="137"><a href="#137">137</a></td></tr
><tr id="gr_svn121_138"

><td id="138"><a href="#138">138</a></td></tr
><tr id="gr_svn121_139"

><td id="139"><a href="#139">139</a></td></tr
><tr id="gr_svn121_140"

><td id="140"><a href="#140">140</a></td></tr
><tr id="gr_svn121_141"

><td id="141"><a href="#141">141</a></td></tr
><tr id="gr_svn121_142"

><td id="142"><a href="#142">142</a></td></tr
><tr id="gr_svn121_143"

><td id="143"><a href="#143">143</a></td></tr
><tr id="gr_svn121_144"

><td id="144"><a href="#144">144</a></td></tr
><tr id="gr_svn121_145"

><td id="145"><a href="#145">145</a></td></tr
><tr id="gr_svn121_146"

><td id="146"><a href="#146">146</a></td></tr
><tr id="gr_svn121_147"

><td id="147"><a href="#147">147</a></td></tr
><tr id="gr_svn121_148"

><td id="148"><a href="#148">148</a></td></tr
><tr id="gr_svn121_149"

><td id="149"><a href="#149">149</a></td></tr
><tr id="gr_svn121_150"

><td id="150"><a href="#150">150</a></td></tr
><tr id="gr_svn121_151"

><td id="151"><a href="#151">151</a></td></tr
><tr id="gr_svn121_152"

><td id="152"><a href="#152">152</a></td></tr
><tr id="gr_svn121_153"

><td id="153"><a href="#153">153</a></td></tr
><tr id="gr_svn121_154"

><td id="154"><a href="#154">154</a></td></tr
><tr id="gr_svn121_155"

><td id="155"><a href="#155">155</a></td></tr
><tr id="gr_svn121_156"

><td id="156"><a href="#156">156</a></td></tr
><tr id="gr_svn121_157"

><td id="157"><a href="#157">157</a></td></tr
><tr id="gr_svn121_158"

><td id="158"><a href="#158">158</a></td></tr
><tr id="gr_svn121_159"

><td id="159"><a href="#159">159</a></td></tr
><tr id="gr_svn121_160"

><td id="160"><a href="#160">160</a></td></tr
><tr id="gr_svn121_161"

><td id="161"><a href="#161">161</a></td></tr
><tr id="gr_svn121_162"

><td id="162"><a href="#162">162</a></td></tr
><tr id="gr_svn121_163"

><td id="163"><a href="#163">163</a></td></tr
><tr id="gr_svn121_164"

><td id="164"><a href="#164">164</a></td></tr
><tr id="gr_svn121_165"

><td id="165"><a href="#165">165</a></td></tr
><tr id="gr_svn121_166"

><td id="166"><a href="#166">166</a></td></tr
><tr id="gr_svn121_167"

><td id="167"><a href="#167">167</a></td></tr
><tr id="gr_svn121_168"

><td id="168"><a href="#168">168</a></td></tr
><tr id="gr_svn121_169"

><td id="169"><a href="#169">169</a></td></tr
><tr id="gr_svn121_170"

><td id="170"><a href="#170">170</a></td></tr
><tr id="gr_svn121_171"

><td id="171"><a href="#171">171</a></td></tr
><tr id="gr_svn121_172"

><td id="172"><a href="#172">172</a></td></tr
><tr id="gr_svn121_173"

><td id="173"><a href="#173">173</a></td></tr
><tr id="gr_svn121_174"

><td id="174"><a href="#174">174</a></td></tr
><tr id="gr_svn121_175"

><td id="175"><a href="#175">175</a></td></tr
><tr id="gr_svn121_176"

><td id="176"><a href="#176">176</a></td></tr
><tr id="gr_svn121_177"

><td id="177"><a href="#177">177</a></td></tr
><tr id="gr_svn121_178"

><td id="178"><a href="#178">178</a></td></tr
><tr id="gr_svn121_179"

><td id="179"><a href="#179">179</a></td></tr
><tr id="gr_svn121_180"

><td id="180"><a href="#180">180</a></td></tr
><tr id="gr_svn121_181"

><td id="181"><a href="#181">181</a></td></tr
><tr id="gr_svn121_182"

><td id="182"><a href="#182">182</a></td></tr
><tr id="gr_svn121_183"

><td id="183"><a href="#183">183</a></td></tr
><tr id="gr_svn121_184"

><td id="184"><a href="#184">184</a></td></tr
><tr id="gr_svn121_185"

><td id="185"><a href="#185">185</a></td></tr
><tr id="gr_svn121_186"

><td id="186"><a href="#186">186</a></td></tr
><tr id="gr_svn121_187"

><td id="187"><a href="#187">187</a></td></tr
><tr id="gr_svn121_188"

><td id="188"><a href="#188">188</a></td></tr
><tr id="gr_svn121_189"

><td id="189"><a href="#189">189</a></td></tr
><tr id="gr_svn121_190"

><td id="190"><a href="#190">190</a></td></tr
><tr id="gr_svn121_191"

><td id="191"><a href="#191">191</a></td></tr
><tr id="gr_svn121_192"

><td id="192"><a href="#192">192</a></td></tr
><tr id="gr_svn121_193"

><td id="193"><a href="#193">193</a></td></tr
><tr id="gr_svn121_194"

><td id="194"><a href="#194">194</a></td></tr
><tr id="gr_svn121_195"

><td id="195"><a href="#195">195</a></td></tr
><tr id="gr_svn121_196"

><td id="196"><a href="#196">196</a></td></tr
><tr id="gr_svn121_197"

><td id="197"><a href="#197">197</a></td></tr
><tr id="gr_svn121_198"

><td id="198"><a href="#198">198</a></td></tr
><tr id="gr_svn121_199"

><td id="199"><a href="#199">199</a></td></tr
><tr id="gr_svn121_200"

><td id="200"><a href="#200">200</a></td></tr
><tr id="gr_svn121_201"

><td id="201"><a href="#201">201</a></td></tr
><tr id="gr_svn121_202"

><td id="202"><a href="#202">202</a></td></tr
><tr id="gr_svn121_203"

><td id="203"><a href="#203">203</a></td></tr
><tr id="gr_svn121_204"

><td id="204"><a href="#204">204</a></td></tr
><tr id="gr_svn121_205"

><td id="205"><a href="#205">205</a></td></tr
><tr id="gr_svn121_206"

><td id="206"><a href="#206">206</a></td></tr
><tr id="gr_svn121_207"

><td id="207"><a href="#207">207</a></td></tr
><tr id="gr_svn121_208"

><td id="208"><a href="#208">208</a></td></tr
><tr id="gr_svn121_209"

><td id="209"><a href="#209">209</a></td></tr
><tr id="gr_svn121_210"

><td id="210"><a href="#210">210</a></td></tr
><tr id="gr_svn121_211"

><td id="211"><a href="#211">211</a></td></tr
><tr id="gr_svn121_212"

><td id="212"><a href="#212">212</a></td></tr
><tr id="gr_svn121_213"

><td id="213"><a href="#213">213</a></td></tr
><tr id="gr_svn121_214"

><td id="214"><a href="#214">214</a></td></tr
><tr id="gr_svn121_215"

><td id="215"><a href="#215">215</a></td></tr
><tr id="gr_svn121_216"

><td id="216"><a href="#216">216</a></td></tr
><tr id="gr_svn121_217"

><td id="217"><a href="#217">217</a></td></tr
><tr id="gr_svn121_218"

><td id="218"><a href="#218">218</a></td></tr
><tr id="gr_svn121_219"

><td id="219"><a href="#219">219</a></td></tr
><tr id="gr_svn121_220"

><td id="220"><a href="#220">220</a></td></tr
><tr id="gr_svn121_221"

><td id="221"><a href="#221">221</a></td></tr
><tr id="gr_svn121_222"

><td id="222"><a href="#222">222</a></td></tr
><tr id="gr_svn121_223"

><td id="223"><a href="#223">223</a></td></tr
><tr id="gr_svn121_224"

><td id="224"><a href="#224">224</a></td></tr
><tr id="gr_svn121_225"

><td id="225"><a href="#225">225</a></td></tr
><tr id="gr_svn121_226"

><td id="226"><a href="#226">226</a></td></tr
><tr id="gr_svn121_227"

><td id="227"><a href="#227">227</a></td></tr
><tr id="gr_svn121_228"

><td id="228"><a href="#228">228</a></td></tr
><tr id="gr_svn121_229"

><td id="229"><a href="#229">229</a></td></tr
><tr id="gr_svn121_230"

><td id="230"><a href="#230">230</a></td></tr
><tr id="gr_svn121_231"

><td id="231"><a href="#231">231</a></td></tr
><tr id="gr_svn121_232"

><td id="232"><a href="#232">232</a></td></tr
><tr id="gr_svn121_233"

><td id="233"><a href="#233">233</a></td></tr
><tr id="gr_svn121_234"

><td id="234"><a href="#234">234</a></td></tr
><tr id="gr_svn121_235"

><td id="235"><a href="#235">235</a></td></tr
><tr id="gr_svn121_236"

><td id="236"><a href="#236">236</a></td></tr
><tr id="gr_svn121_237"

><td id="237"><a href="#237">237</a></td></tr
><tr id="gr_svn121_238"

><td id="238"><a href="#238">238</a></td></tr
><tr id="gr_svn121_239"

><td id="239"><a href="#239">239</a></td></tr
><tr id="gr_svn121_240"

><td id="240"><a href="#240">240</a></td></tr
><tr id="gr_svn121_241"

><td id="241"><a href="#241">241</a></td></tr
><tr id="gr_svn121_242"

><td id="242"><a href="#242">242</a></td></tr
><tr id="gr_svn121_243"

><td id="243"><a href="#243">243</a></td></tr
><tr id="gr_svn121_244"

><td id="244"><a href="#244">244</a></td></tr
><tr id="gr_svn121_245"

><td id="245"><a href="#245">245</a></td></tr
><tr id="gr_svn121_246"

><td id="246"><a href="#246">246</a></td></tr
><tr id="gr_svn121_247"

><td id="247"><a href="#247">247</a></td></tr
><tr id="gr_svn121_248"

><td id="248"><a href="#248">248</a></td></tr
><tr id="gr_svn121_249"

><td id="249"><a href="#249">249</a></td></tr
><tr id="gr_svn121_250"

><td id="250"><a href="#250">250</a></td></tr
><tr id="gr_svn121_251"

><td id="251"><a href="#251">251</a></td></tr
><tr id="gr_svn121_252"

><td id="252"><a href="#252">252</a></td></tr
><tr id="gr_svn121_253"

><td id="253"><a href="#253">253</a></td></tr
><tr id="gr_svn121_254"

><td id="254"><a href="#254">254</a></td></tr
><tr id="gr_svn121_255"

><td id="255"><a href="#255">255</a></td></tr
><tr id="gr_svn121_256"

><td id="256"><a href="#256">256</a></td></tr
><tr id="gr_svn121_257"

><td id="257"><a href="#257">257</a></td></tr
><tr id="gr_svn121_258"

><td id="258"><a href="#258">258</a></td></tr
><tr id="gr_svn121_259"

><td id="259"><a href="#259">259</a></td></tr
><tr id="gr_svn121_260"

><td id="260"><a href="#260">260</a></td></tr
><tr id="gr_svn121_261"

><td id="261"><a href="#261">261</a></td></tr
><tr id="gr_svn121_262"

><td id="262"><a href="#262">262</a></td></tr
><tr id="gr_svn121_263"

><td id="263"><a href="#263">263</a></td></tr
><tr id="gr_svn121_264"

><td id="264"><a href="#264">264</a></td></tr
><tr id="gr_svn121_265"

><td id="265"><a href="#265">265</a></td></tr
><tr id="gr_svn121_266"

><td id="266"><a href="#266">266</a></td></tr
><tr id="gr_svn121_267"

><td id="267"><a href="#267">267</a></td></tr
><tr id="gr_svn121_268"

><td id="268"><a href="#268">268</a></td></tr
><tr id="gr_svn121_269"

><td id="269"><a href="#269">269</a></td></tr
><tr id="gr_svn121_270"

><td id="270"><a href="#270">270</a></td></tr
><tr id="gr_svn121_271"

><td id="271"><a href="#271">271</a></td></tr
><tr id="gr_svn121_272"

><td id="272"><a href="#272">272</a></td></tr
><tr id="gr_svn121_273"

><td id="273"><a href="#273">273</a></td></tr
><tr id="gr_svn121_274"

><td id="274"><a href="#274">274</a></td></tr
><tr id="gr_svn121_275"

><td id="275"><a href="#275">275</a></td></tr
><tr id="gr_svn121_276"

><td id="276"><a href="#276">276</a></td></tr
><tr id="gr_svn121_277"

><td id="277"><a href="#277">277</a></td></tr
><tr id="gr_svn121_278"

><td id="278"><a href="#278">278</a></td></tr
><tr id="gr_svn121_279"

><td id="279"><a href="#279">279</a></td></tr
><tr id="gr_svn121_280"

><td id="280"><a href="#280">280</a></td></tr
><tr id="gr_svn121_281"

><td id="281"><a href="#281">281</a></td></tr
><tr id="gr_svn121_282"

><td id="282"><a href="#282">282</a></td></tr
><tr id="gr_svn121_283"

><td id="283"><a href="#283">283</a></td></tr
><tr id="gr_svn121_284"

><td id="284"><a href="#284">284</a></td></tr
><tr id="gr_svn121_285"

><td id="285"><a href="#285">285</a></td></tr
><tr id="gr_svn121_286"

><td id="286"><a href="#286">286</a></td></tr
><tr id="gr_svn121_287"

><td id="287"><a href="#287">287</a></td></tr
><tr id="gr_svn121_288"

><td id="288"><a href="#288">288</a></td></tr
><tr id="gr_svn121_289"

><td id="289"><a href="#289">289</a></td></tr
><tr id="gr_svn121_290"

><td id="290"><a href="#290">290</a></td></tr
><tr id="gr_svn121_291"

><td id="291"><a href="#291">291</a></td></tr
><tr id="gr_svn121_292"

><td id="292"><a href="#292">292</a></td></tr
><tr id="gr_svn121_293"

><td id="293"><a href="#293">293</a></td></tr
></table></pre>
<pre><table width="100%"><tr class="nocursor"><td></td></tr></table></pre>
</td>
<td id="lines">
<pre><table width="100%"><tr class="cursor_stop cursor_hidden"><td></td></tr></table></pre>
<pre class="prettyprint lang-html"><table id="src_table_0"><tr
id=sl_svn121_1

><td class="source">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot;<br></td></tr
><tr
id=sl_svn121_2

><td class="source">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;<br></td></tr
><tr
id=sl_svn121_3

><td class="source">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot;&gt;<br></td></tr
><tr
id=sl_svn121_4

><td class="source">&lt;head&gt;<br></td></tr
><tr
id=sl_svn121_5

><td class="source">  &lt;title&gt;Earth API - KML DOM Tree&lt;/title&gt;<br></td></tr
><tr
id=sl_svn121_6

><td class="source">  &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;<br></td></tr
><tr
id=sl_svn121_7

><td class="source">  &lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw&quot;&gt;&lt;/script&gt;<br></td></tr
><tr
id=sl_svn121_8

><td class="source">  &lt;script type=&quot;text/javascript&quot; src=&quot;../../lib/ge-poly-fit-hack.js&quot;&gt;&lt;/script&gt;<br></td></tr
><tr
id=sl_svn121_9

><td class="source">  &lt;script type=&quot;text/javascript&quot; src=&quot;../../lib/kmldomwalk.js&quot;&gt;&lt;/script&gt;<br></td></tr
><tr
id=sl_svn121_10

><td class="source">  &lt;style type=&quot;text/css&quot;&gt;<br></td></tr
><tr
id=sl_svn121_11

><td class="source">    @import &quot;http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dijit/themes/tundra/tundra.css&quot;;<br></td></tr
><tr
id=sl_svn121_12

><td class="source">    @import &quot;http://ajax.googleapis.com/ajax/libs/dojo/1.2.3/dojo/resources/dojo.css&quot;;<br></td></tr
><tr
id=sl_svn121_13

><td class="source">  &lt;/style&gt;<br></td></tr
><tr
id=sl_svn121_14

><td class="source">  <br></td></tr
><tr
id=sl_svn121_15

><td class="source">  &lt;style type=&quot;text/css&quot;&gt;@import &quot;index.css&quot;;&lt;/style&gt;<br></td></tr
><tr
id=sl_svn121_16

><td class="source">&lt;script type=&quot;text/javascript&quot;&gt;<br></td></tr
><tr
id=sl_svn121_17

><td class="source">// &lt;![CDATA[<br></td></tr
><tr
id=sl_svn121_18

><td class="source"><br></td></tr
><tr
id=sl_svn121_19

><td class="source">djConfig = { parseOnLoad: true };<br></td></tr
><tr
id=sl_svn121_20

><td class="source">google.load(&#39;dojo&#39;, &#39;1.2.3&#39;);<br></td></tr
><tr
id=sl_svn121_21

><td class="source"><br></td></tr
><tr
id=sl_svn121_22

><td class="source">google.load(&#39;maps&#39;, &#39;2&#39;);<br></td></tr
><tr
id=sl_svn121_23

><td class="source">google.load(&#39;earth&#39;, &#39;1&#39;);<br></td></tr
><tr
id=sl_svn121_24

><td class="source"><br></td></tr
><tr
id=sl_svn121_25

><td class="source">var g_ge;<br></td></tr
><tr
id=sl_svn121_26

><td class="source">var g_earthDisabled = false;<br></td></tr
><tr
id=sl_svn121_27

><td class="source">var g_kmlObject;<br></td></tr
><tr
id=sl_svn121_28

><td class="source"><br></td></tr
><tr
id=sl_svn121_29

><td class="source">google.setOnLoadCallback(function() {<br></td></tr
><tr
id=sl_svn121_30

><td class="source">  dojo.require(&#39;dijit.layout.BorderContainer&#39;);<br></td></tr
><tr
id=sl_svn121_31

><td class="source">  dojo.require(&#39;dijit.layout.SplitContainer&#39;);<br></td></tr
><tr
id=sl_svn121_32

><td class="source">  dojo.require(&#39;dijit.layout.ContentPane&#39;);<br></td></tr
><tr
id=sl_svn121_33

><td class="source">  dojo.require(&#39;dijit.Tree&#39;);<br></td></tr
><tr
id=sl_svn121_34

><td class="source">  //dojo.require(&#39;dijit.CheckboxTree&#39;);<br></td></tr
><tr
id=sl_svn121_35

><td class="source">  dojo.require(&quot;dijit.form.CheckBox&quot;);<br></td></tr
><tr
id=sl_svn121_36

><td class="source">  dojo.require(&#39;dijit.form.Button&#39;);<br></td></tr
><tr
id=sl_svn121_37

><td class="source">  dojo.require(&#39;dijit.form.TextBox&#39;);<br></td></tr
><tr
id=sl_svn121_38

><td class="source"><br></td></tr
><tr
id=sl_svn121_39

><td class="source">  dojo.require(&#39;dojo.data.ItemFileWriteStore&#39;);<br></td></tr
><tr
id=sl_svn121_40

><td class="source">  <br></td></tr
><tr
id=sl_svn121_41

><td class="source">  dojo.require(&#39;dojo.parser&#39;);<br></td></tr
><tr
id=sl_svn121_42

><td class="source">  dojo.require(&#39;dojo.cookie&#39;);<br></td></tr
><tr
id=sl_svn121_43

><td class="source">  dojo.require(&#39;dojo.fx&#39;);<br></td></tr
><tr
id=sl_svn121_44

><td class="source"> <br></td></tr
><tr
id=sl_svn121_45

><td class="source">  dojo.addOnLoad(function() { <br></td></tr
><tr
id=sl_svn121_46

><td class="source">    // load checkboxtree<br></td></tr
><tr
id=sl_svn121_47

><td class="source">    var scpt = document.createElement(&#39;script&#39;);<br></td></tr
><tr
id=sl_svn121_48

><td class="source">    scpt.src = &#39;dijit.CheckboxTree.js&#39;;<br></td></tr
><tr
id=sl_svn121_49

><td class="source">    document.body.appendChild(scpt);<br></td></tr
><tr
id=sl_svn121_50

><td class="source">    <br></td></tr
><tr
id=sl_svn121_51

><td class="source">    dijit.byId(&#39;load-button&#39;).setDisabled(true);<br></td></tr
><tr
id=sl_svn121_52

><td class="source">    // build earth<br></td></tr
><tr
id=sl_svn121_53

><td class="source">    google.earth.createInstance(<br></td></tr
><tr
id=sl_svn121_54

><td class="source">      &#39;map3d&#39;,<br></td></tr
><tr
id=sl_svn121_55

><td class="source">      function(ge) {<br></td></tr
><tr
id=sl_svn121_56

><td class="source">        g_ge = ge;<br></td></tr
><tr
id=sl_svn121_57

><td class="source">        g_ge.getWindow().setVisibility(true);<br></td></tr
><tr
id=sl_svn121_58

><td class="source">        g_ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);<br></td></tr
><tr
id=sl_svn121_59

><td class="source">        g_ge.getLayerRoot().enableLayerById(g_ge.LAYER_BORDERS, true);<br></td></tr
><tr
id=sl_svn121_60

><td class="source">        g_ge.getLayerRoot().enableLayerById(g_ge.LAYER_BUILDINGS, true);<br></td></tr
><tr
id=sl_svn121_61

><td class="source">        <br></td></tr
><tr
id=sl_svn121_62

><td class="source">        dijit.byId(&#39;load-button&#39;).setDisabled(false);<br></td></tr
><tr
id=sl_svn121_63

><td class="source">        checkAutoload();<br></td></tr
><tr
id=sl_svn121_64

><td class="source">      },<br></td></tr
><tr
id=sl_svn121_65

><td class="source">      function() {<br></td></tr
><tr
id=sl_svn121_66

><td class="source">        g_earthDisabled = true;<br></td></tr
><tr
id=sl_svn121_67

><td class="source">        dijit.byId(&#39;load-button&#39;).setDisabled(true);<br></td></tr
><tr
id=sl_svn121_68

><td class="source">      });<br></td></tr
><tr
id=sl_svn121_69

><td class="source">  });<br></td></tr
><tr
id=sl_svn121_70

><td class="source">});<br></td></tr
><tr
id=sl_svn121_71

><td class="source"><br></td></tr
><tr
id=sl_svn121_72

><td class="source">// If the user supplied a kml url as a CGI param, load it now.<br></td></tr
><tr
id=sl_svn121_73

><td class="source">function checkAutoload() {<br></td></tr
><tr
id=sl_svn121_74

><td class="source">  if (window.location.search.length &gt; 1) {<br></td></tr
><tr
id=sl_svn121_75

><td class="source">    // Parse CGI params.<br></td></tr
><tr
id=sl_svn121_76

><td class="source">    var args = window.location.search.substring(1);<br></td></tr
><tr
id=sl_svn121_77

><td class="source">    var params = {};<br></td></tr
><tr
id=sl_svn121_78

><td class="source">    var pairs = args.split(&#39;&amp;&#39;);<br></td></tr
><tr
id=sl_svn121_79

><td class="source">    for (var i = 0; i &lt; pairs.length; i++) {<br></td></tr
><tr
id=sl_svn121_80

><td class="source">      var p = pairs[i].split(&#39;=&#39;);<br></td></tr
><tr
id=sl_svn121_81

><td class="source">      if (p.length &gt; 1) {<br></td></tr
><tr
id=sl_svn121_82

><td class="source">        params[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);<br></td></tr
><tr
id=sl_svn121_83

><td class="source">      }<br></td></tr
><tr
id=sl_svn121_84

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_85

><td class="source"><br></td></tr
><tr
id=sl_svn121_86

><td class="source">    if (&#39;kml&#39; in params) {<br></td></tr
><tr
id=sl_svn121_87

><td class="source">      var url = params[&#39;kml&#39;];<br></td></tr
><tr
id=sl_svn121_88

><td class="source">      if (url.length &gt; 0) {<br></td></tr
><tr
id=sl_svn121_89

><td class="source">        dijit.byId(&#39;kml-url&#39;).setValue(url);<br></td></tr
><tr
id=sl_svn121_90

><td class="source">        loadKml();<br></td></tr
><tr
id=sl_svn121_91

><td class="source">      }<br></td></tr
><tr
id=sl_svn121_92

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_93

><td class="source">  }<br></td></tr
><tr
id=sl_svn121_94

><td class="source">}<br></td></tr
><tr
id=sl_svn121_95

><td class="source"><br></td></tr
><tr
id=sl_svn121_96

><td class="source">function setPermalink(url) {<br></td></tr
><tr
id=sl_svn121_97

><td class="source">  var link = window.location.toString();<br></td></tr
><tr
id=sl_svn121_98

><td class="source">  link = link.split(&#39;?&#39;)[0] + &#39;?kml=&#39; + encodeURIComponent(url);<br></td></tr
><tr
id=sl_svn121_99

><td class="source">  document.getElementById(&#39;permalink&#39;).href = link;<br></td></tr
><tr
id=sl_svn121_100

><td class="source">}<br></td></tr
><tr
id=sl_svn121_101

><td class="source"><br></td></tr
><tr
id=sl_svn121_102

><td class="source">var g_treeIdObjectMap = null;<br></td></tr
><tr
id=sl_svn121_103

><td class="source"><br></td></tr
><tr
id=sl_svn121_104

><td class="source">function buildTreeUI(kmlObject) {<br></td></tr
><tr
id=sl_svn121_105

><td class="source">  delete g_treeIdObjectMap;<br></td></tr
><tr
id=sl_svn121_106

><td class="source">  g_treeIdObjectMap = {};<br></td></tr
><tr
id=sl_svn121_107

><td class="source">  <br></td></tr
><tr
id=sl_svn121_108

><td class="source">  var treeData = {<br></td></tr
><tr
id=sl_svn121_109

><td class="source">    identifier: &#39;id&#39;,<br></td></tr
><tr
id=sl_svn121_110

><td class="source">    label: &#39;name&#39;,<br></td></tr
><tr
id=sl_svn121_111

><td class="source">    items: []<br></td></tr
><tr
id=sl_svn121_112

><td class="source">  };<br></td></tr
><tr
id=sl_svn121_113

><td class="source">  <br></td></tr
><tr
id=sl_svn121_114

><td class="source">  // walk the loaded KML object DOM<br></td></tr
><tr
id=sl_svn121_115

><td class="source">  walkKmlDom(kmlObject, function(context) {<br></td></tr
><tr
id=sl_svn121_116

><td class="source">    // generate a random, unique ID for this node (Dojo requires a unique ID<br></td></tr
><tr
id=sl_svn121_117

><td class="source">    // per each node)<br></td></tr
><tr
id=sl_svn121_118

><td class="source">    var nodeId = Number(new Date()).toString() + Math.round(Math.random() * 99999).toString();<br></td></tr
><tr
id=sl_svn121_119

><td class="source">    g_treeIdObjectMap[nodeId] = this;<br></td></tr
><tr
id=sl_svn121_120

><td class="source">    <br></td></tr
><tr
id=sl_svn121_121

><td class="source">    // create the tree node for this item<br></td></tr
><tr
id=sl_svn121_122

><td class="source">    var treeNodeData = {<br></td></tr
><tr
id=sl_svn121_123

><td class="source">      id: nodeId,<br></td></tr
><tr
id=sl_svn121_124

><td class="source">      name: (this.getName() ? this.getName() : &#39;&lt;&#39; + this.getType() + &#39;&gt;&#39;),<br></td></tr
><tr
id=sl_svn121_125

><td class="source">      type: this.getType(),<br></td></tr
><tr
id=sl_svn121_126

><td class="source">      checked: this.getVisibility(),<br></td></tr
><tr
id=sl_svn121_127

><td class="source">      children: []<br></td></tr
><tr
id=sl_svn121_128

><td class="source">    };<br></td></tr
><tr
id=sl_svn121_129

><td class="source">    <br></td></tr
><tr
id=sl_svn121_130

><td class="source">    // add the tree node to the tree data hierarchy <br></td></tr
><tr
id=sl_svn121_131

><td class="source">    context.current.push(treeNodeData);<br></td></tr
><tr
id=sl_svn121_132

><td class="source">    <br></td></tr
><tr
id=sl_svn121_133

><td class="source">    // all actual KML child nodes will be added to this tree node&#39;s<br></td></tr
><tr
id=sl_svn121_134

><td class="source">    // children list<br></td></tr
><tr
id=sl_svn121_135

><td class="source">    context.child = treeNodeData.children;<br></td></tr
><tr
id=sl_svn121_136

><td class="source">  }, { rootContext: treeData.items });<br></td></tr
><tr
id=sl_svn121_137

><td class="source">  <br></td></tr
><tr
id=sl_svn121_138

><td class="source">  if (dijit.byId(&#39;tree&#39;))<br></td></tr
><tr
id=sl_svn121_139

><td class="source">    dijit.byId(&#39;tree&#39;).destroy();<br></td></tr
><tr
id=sl_svn121_140

><td class="source">  <br></td></tr
><tr
id=sl_svn121_141

><td class="source">  // create the Dojo tree widget<br></td></tr
><tr
id=sl_svn121_142

><td class="source">  // and set its data to the hierarchy we just<br></td></tr
><tr
id=sl_svn121_143

><td class="source">  // built using walkKmlDom<br></td></tr
><tr
id=sl_svn121_144

><td class="source">  var treeDiv = document.createElement(&#39;div&#39;);<br></td></tr
><tr
id=sl_svn121_145

><td class="source">  treeDiv.style.height = &#39;100%&#39;;<br></td></tr
><tr
id=sl_svn121_146

><td class="source">  dojo.byId(&#39;left&#39;).appendChild(treeDiv);<br></td></tr
><tr
id=sl_svn121_147

><td class="source">  <br></td></tr
><tr
id=sl_svn121_148

><td class="source">  var store = new dojo.data.ItemFileWriteStore({ data: treeData });<br></td></tr
><tr
id=sl_svn121_149

><td class="source">  <br></td></tr
><tr
id=sl_svn121_150

><td class="source">  var model = new dijit.tree.CheckboxForestStoreModel({<br></td></tr
><tr
id=sl_svn121_151

><td class="source">    store: store,<br></td></tr
><tr
id=sl_svn121_152

><td class="source">    labelAttr: &#39;name&#39;,<br></td></tr
><tr
id=sl_svn121_153

><td class="source">    typeAttr: &#39;type&#39;<br></td></tr
><tr
id=sl_svn121_154

><td class="source">  });<br></td></tr
><tr
id=sl_svn121_155

><td class="source">  <br></td></tr
><tr
id=sl_svn121_156

><td class="source">  var tree = new dijit.CheckboxTree({<br></td></tr
><tr
id=sl_svn121_157

><td class="source">    id: &#39;tree&#39;,<br></td></tr
><tr
id=sl_svn121_158

><td class="source">    model: model<br></td></tr
><tr
id=sl_svn121_159

><td class="source">  }, treeDiv);<br></td></tr
><tr
id=sl_svn121_160

><td class="source">  <br></td></tr
><tr
id=sl_svn121_161

><td class="source">  // watch for changes in the &#39;checked&#39; attribute and update feature visibility<br></td></tr
><tr
id=sl_svn121_162

><td class="source">  // accordingly<br></td></tr
><tr
id=sl_svn121_163

><td class="source">  dojo.connect(store, &#39;onSet&#39;, function(item, attribute, oldValue, newValue) {<br></td></tr
><tr
id=sl_svn121_164

><td class="source">    if (oldValue != newValue &amp;&amp;<br></td></tr
><tr
id=sl_svn121_165

><td class="source">        attribute == &#39;checked&#39;) {<br></td></tr
><tr
id=sl_svn121_166

><td class="source">      var kmlObject = g_treeIdObjectMap[store.getValue(item, &#39;id&#39;)];<br></td></tr
><tr
id=sl_svn121_167

><td class="source">      if (!kmlObject)<br></td></tr
><tr
id=sl_svn121_168

><td class="source">        return;<br></td></tr
><tr
id=sl_svn121_169

><td class="source">      <br></td></tr
><tr
id=sl_svn121_170

><td class="source">      kmlObject.setVisibility(newValue);<br></td></tr
><tr
id=sl_svn121_171

><td class="source">      <br></td></tr
><tr
id=sl_svn121_172

><td class="source">      if (newValue == true) {<br></td></tr
><tr
id=sl_svn121_173

><td class="source">        var c = kmlObject;<br></td></tr
><tr
id=sl_svn121_174

><td class="source">        while (c &amp;&amp; &#39;setVisibility&#39; in c) {<br></td></tr
><tr
id=sl_svn121_175

><td class="source">          c.setVisibility(newValue);<br></td></tr
><tr
id=sl_svn121_176

><td class="source">          c = c.getParentNode();<br></td></tr
><tr
id=sl_svn121_177

><td class="source">          //store.setValue(item, &#39;checked&#39; <br></td></tr
><tr
id=sl_svn121_178

><td class="source">        }<br></td></tr
><tr
id=sl_svn121_179

><td class="source">      }<br></td></tr
><tr
id=sl_svn121_180

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_181

><td class="source">  });<br></td></tr
><tr
id=sl_svn121_182

><td class="source">  <br></td></tr
><tr
id=sl_svn121_183

><td class="source">  // when clicking a tree item, fly to it<br></td></tr
><tr
id=sl_svn121_184

><td class="source">  dojo.connect(tree, &#39;onClick&#39;, function(item) {<br></td></tr
><tr
id=sl_svn121_185

><td class="source">    if (item) {<br></td></tr
><tr
id=sl_svn121_186

><td class="source">      var kmlObject = g_treeIdObjectMap[store.getValue(item, &#39;id&#39;)];<br></td></tr
><tr
id=sl_svn121_187

><td class="source">      if (!kmlObject)<br></td></tr
><tr
id=sl_svn121_188

><td class="source">        return;<br></td></tr
><tr
id=sl_svn121_189

><td class="source">      <br></td></tr
><tr
id=sl_svn121_190

><td class="source">      flyToFeature(kmlObject);<br></td></tr
><tr
id=sl_svn121_191

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_192

><td class="source">  });<br></td></tr
><tr
id=sl_svn121_193

><td class="source">  <br></td></tr
><tr
id=sl_svn121_194

><td class="source">  var oldGetIconClass = tree.getIconClass;<br></td></tr
><tr
id=sl_svn121_195

><td class="source">  tree.getIconClass = function(item, opened) {<br></td></tr
><tr
id=sl_svn121_196

><td class="source">    var cls = &#39;&#39;;<br></td></tr
><tr
id=sl_svn121_197

><td class="source">    if (item) {<br></td></tr
><tr
id=sl_svn121_198

><td class="source">      var kmlObject = g_treeIdObjectMap[store.getValue(item, &#39;id&#39;)];<br></td></tr
><tr
id=sl_svn121_199

><td class="source">      if (kmlObject) {<br></td></tr
><tr
id=sl_svn121_200

><td class="source">        if (&#39;getGeometry&#39; in kmlObject &amp;&amp; kmlObject.getGeometry()) {<br></td></tr
><tr
id=sl_svn121_201

><td class="source">          cls = kmlObject.getGeometry().getType();<br></td></tr
><tr
id=sl_svn121_202

><td class="source">        } else {<br></td></tr
><tr
id=sl_svn121_203

><td class="source">          cls = kmlObject.getType();<br></td></tr
><tr
id=sl_svn121_204

><td class="source">        }<br></td></tr
><tr
id=sl_svn121_205

><td class="source">      }<br></td></tr
><tr
id=sl_svn121_206

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_207

><td class="source">    <br></td></tr
><tr
id=sl_svn121_208

><td class="source">    return cls + &#39; &#39; + oldGetIconClass.apply(tree, [item, opened]);<br></td></tr
><tr
id=sl_svn121_209

><td class="source">  };<br></td></tr
><tr
id=sl_svn121_210

><td class="source">  <br></td></tr
><tr
id=sl_svn121_211

><td class="source">  tree.getLabelClass = function(item, opened) {<br></td></tr
><tr
id=sl_svn121_212

><td class="source">    if (item &amp;&amp; tree.model.mayHaveChildren(item)) {<br></td></tr
><tr
id=sl_svn121_213

><td class="source">      return &#39;folder&#39;;<br></td></tr
><tr
id=sl_svn121_214

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_215

><td class="source">    <br></td></tr
><tr
id=sl_svn121_216

><td class="source">    return &#39;&#39;;<br></td></tr
><tr
id=sl_svn121_217

><td class="source">  };<br></td></tr
><tr
id=sl_svn121_218

><td class="source">  <br></td></tr
><tr
id=sl_svn121_219

><td class="source">  expandTree();<br></td></tr
><tr
id=sl_svn121_220

><td class="source">}<br></td></tr
><tr
id=sl_svn121_221

><td class="source"><br></td></tr
><tr
id=sl_svn121_222

><td class="source">function expandTree() {<br></td></tr
><tr
id=sl_svn121_223

><td class="source">  var tree = dijit.byId(&#39;tree&#39;);<br></td></tr
><tr
id=sl_svn121_224

><td class="source">  <br></td></tr
><tr
id=sl_svn121_225

><td class="source">  function expandChildNode(node) {<br></td></tr
><tr
id=sl_svn121_226

><td class="source">    dojo.forEach(node.getChildren(), function(c) { <br></td></tr
><tr
id=sl_svn121_227

><td class="source">      tree._expandNode(c);<br></td></tr
><tr
id=sl_svn121_228

><td class="source">      expandChildNode(c);<br></td></tr
><tr
id=sl_svn121_229

><td class="source">    }, this);<br></td></tr
><tr
id=sl_svn121_230

><td class="source">  }<br></td></tr
><tr
id=sl_svn121_231

><td class="source">  <br></td></tr
><tr
id=sl_svn121_232

><td class="source">  expandChildNode(tree.rootNode);<br></td></tr
><tr
id=sl_svn121_233

><td class="source">}<br></td></tr
><tr
id=sl_svn121_234

><td class="source"><br></td></tr
><tr
id=sl_svn121_235

><td class="source">function loadKml() {<br></td></tr
><tr
id=sl_svn121_236

><td class="source">  var url = dijit.byId(&#39;kml-url&#39;).getValue();<br></td></tr
><tr
id=sl_svn121_237

><td class="source">  setPermalink(url);<br></td></tr
><tr
id=sl_svn121_238

><td class="source">  <br></td></tr
><tr
id=sl_svn121_239

><td class="source">  google.earth.fetchKml(g_ge, url, function(kmlObject) {<br></td></tr
><tr
id=sl_svn121_240

><td class="source">    if (!kmlObject) {<br></td></tr
><tr
id=sl_svn121_241

><td class="source">      // show error<br></td></tr
><tr
id=sl_svn121_242

><td class="source">      setTimeout(function() {<br></td></tr
><tr
id=sl_svn121_243

><td class="source">        alert(&#39;Error loading KML.&#39;);<br></td></tr
><tr
id=sl_svn121_244

><td class="source">      }, 0);<br></td></tr
><tr
id=sl_svn121_245

><td class="source">      return;<br></td></tr
><tr
id=sl_svn121_246

><td class="source">    }<br></td></tr
><tr
id=sl_svn121_247

><td class="source">    <br></td></tr
><tr
id=sl_svn121_248

><td class="source">    if (g_kmlObject)<br></td></tr
><tr
id=sl_svn121_249

><td class="source">      g_ge.getFeatures().removeChild(g_kmlObject);<br></td></tr
><tr
id=sl_svn121_250

><td class="source">    <br></td></tr
><tr
id=sl_svn121_251

><td class="source">    g_kmlObject = kmlObject;<br></td></tr
><tr
id=sl_svn121_252

><td class="source">    g_ge.getFeatures().appendChild(g_kmlObject);<br></td></tr
><tr
id=sl_svn121_253

><td class="source">    flyToFeature(g_kmlObject);<br></td></tr
><tr
id=sl_svn121_254

><td class="source">    <br></td></tr
><tr
id=sl_svn121_255

><td class="source">    buildTreeUI(g_kmlObject);<br></td></tr
><tr
id=sl_svn121_256

><td class="source">  });<br></td></tr
><tr
id=sl_svn121_257

><td class="source">}<br></td></tr
><tr
id=sl_svn121_258

><td class="source"><br></td></tr
><tr
id=sl_svn121_259

><td class="source">function flyToFeature(kmlFeature) {<br></td></tr
><tr
id=sl_svn121_260

><td class="source">  var aspectRatio = dojo.coords(&#39;center&#39;).w * 1.0 / dojo.coords(&#39;center&#39;).h;<br></td></tr
><tr
id=sl_svn121_261

><td class="source">  var lookAt = computeFitLookAt(g_ge, kmlFeature, aspectRatio);<br></td></tr
><tr
id=sl_svn121_262

><td class="source">  if (lookAt)<br></td></tr
><tr
id=sl_svn121_263

><td class="source">    g_ge.getView().setAbstractView(lookAt);<br></td></tr
><tr
id=sl_svn121_264

><td class="source">}<br></td></tr
><tr
id=sl_svn121_265

><td class="source"><br></td></tr
><tr
id=sl_svn121_266

><td class="source">// ]]&gt;<br></td></tr
><tr
id=sl_svn121_267

><td class="source">&lt;/script&gt;<br></td></tr
><tr
id=sl_svn121_268

><td class="source">&lt;/head&gt;<br></td></tr
><tr
id=sl_svn121_269

><td class="source">&lt;body class=&quot;tundra&quot;&gt;<br></td></tr
><tr
id=sl_svn121_270

><td class="source">  &lt;div id=&quot;container&quot; dojoType=&quot;dijit.layout.BorderContainer&quot; gutters=&quot;false&quot; region=&quot;center&quot; style=&quot;height: 100%&quot;&gt;<br></td></tr
><tr
id=sl_svn121_271

><td class="source">  <br></td></tr
><tr
id=sl_svn121_272

><td class="source">    &lt;div id=&quot;top&quot; dojoType=&quot;dijit.layout.ContentPane&quot; region=&quot;top&quot;&gt;<br></td></tr
><tr
id=sl_svn121_273

><td class="source">      &lt;h1 style=&quot;margin:0; padding:0&quot;&gt;Earth API - KML DOM Tree&lt;/h1&gt;<br></td></tr
><tr
id=sl_svn121_274

><td class="source">      &lt;input id=&quot;kml-url&quot; dojoType=&quot;dijit.form.TextBox&quot; value=&quot;http://code.google.com/apis/kml/documentation/KML_Samples.kml&quot;/&gt;<br></td></tr
><tr
id=sl_svn121_275

><td class="source">      &lt;button id=&quot;load-button&quot; dojoType=&quot;dijit.form.Button&quot; onclick=&quot;loadKml();&quot;&gt;Load KML or KMZ&lt;/button&gt;<br></td></tr
><tr
id=sl_svn121_276

><td class="source">      &lt;a id=&quot;permalink&quot; href=&quot;&quot;&gt;permalink&lt;/a&gt;<br></td></tr
><tr
id=sl_svn121_277

><td class="source">    &lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_278

><td class="source">    <br></td></tr
><tr
id=sl_svn121_279

><td class="source">    &lt;div id=&quot;left&quot; dojoType=&quot;dijit.layout.ContentPane&quot; region=&quot;left&quot;<br></td></tr
><tr
id=sl_svn121_280

><td class="source">      splitter=&quot;true&quot; minsize=&quot;200&quot; style=&quot;width: 350px;&quot;&gt;<br></td></tr
><tr
id=sl_svn121_281

><td class="source">      <br></td></tr
><tr
id=sl_svn121_282

><td class="source">    &lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_283

><td class="source">  <br></td></tr
><tr
id=sl_svn121_284

><td class="source">    &lt;div id=&quot;center&quot; dojoType=&quot;dijit.layout.ContentPane&quot; region=&quot;center&quot;&gt;<br></td></tr
><tr
id=sl_svn121_285

><td class="source">      &lt;div id=&quot;map3d&quot; style=&quot;height: 100%&quot;&gt;&lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_286

><td class="source">    &lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_287

><td class="source">    <br></td></tr
><tr
id=sl_svn121_288

><td class="source">    &lt;div id=&quot;bottom&quot; dojoType=&quot;dijit.layout.ContentPane&quot; region=&quot;bottom&quot;&gt;<br></td></tr
><tr
id=sl_svn121_289

><td class="source">    &lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_290

><td class="source">  <br></td></tr
><tr
id=sl_svn121_291

><td class="source">  &lt;/div&gt;<br></td></tr
><tr
id=sl_svn121_292

><td class="source">&lt;/body&gt;<br></td></tr
><tr
id=sl_svn121_293

><td class="source">&lt;/html&gt;<br></td></tr
></table></pre>
<pre><table width="100%"><tr class="cursor_stop cursor_hidden"><td></td></tr></table></pre>
</td>
</tr></table>

 
<script type="text/javascript">
 var lineNumUnderMouse = -1;
 
 function gutterOver(num) {
 gutterOut();
 var newTR = document.getElementById('gr_svn121_' + num);
 if (newTR) {
 newTR.className = 'undermouse';
 }
 lineNumUnderMouse = num;
 }
 function gutterOut() {
 if (lineNumUnderMouse != -1) {
 var oldTR = document.getElementById(
 'gr_svn121_' + lineNumUnderMouse);
 if (oldTR) {
 oldTR.className = '';
 }
 lineNumUnderMouse = -1;
 }
 }
 var numsGenState = {table_base_id: 'nums_table_'};
 var srcGenState = {table_base_id: 'src_table_'};
 var alignerRunning = false;
 var startOver = false;
 function setLineNumberHeights() {
 if (alignerRunning) {
 startOver = true;
 return;
 }
 numsGenState.chunk_id = 0;
 numsGenState.table = document.getElementById('nums_table_0');
 numsGenState.row_num = 0;
 if (!numsGenState.table) {
 return; // Silently exit if no file is present.
 }
 srcGenState.chunk_id = 0;
 srcGenState.table = document.getElementById('src_table_0');
 srcGenState.row_num = 0;
 alignerRunning = true;
 continueToSetLineNumberHeights();
 }
 function rowGenerator(genState) {
 if (genState.row_num < genState.table.rows.length) {
 var currentRow = genState.table.rows[genState.row_num];
 genState.row_num++;
 return currentRow;
 }
 var newTable = document.getElementById(
 genState.table_base_id + (genState.chunk_id + 1));
 if (newTable) {
 genState.chunk_id++;
 genState.row_num = 0;
 genState.table = newTable;
 return genState.table.rows[0];
 }
 return null;
 }
 var MAX_ROWS_PER_PASS = 1000;
 function continueToSetLineNumberHeights() {
 var rowsInThisPass = 0;
 var numRow = 1;
 var srcRow = 1;
 while (numRow && srcRow && rowsInThisPass < MAX_ROWS_PER_PASS) {
 numRow = rowGenerator(numsGenState);
 srcRow = rowGenerator(srcGenState);
 rowsInThisPass++;
 if (numRow && srcRow) {
 if (numRow.offsetHeight != srcRow.offsetHeight) {
 numRow.firstChild.style.height = srcRow.offsetHeight + 'px';
 }
 }
 }
 if (rowsInThisPass >= MAX_ROWS_PER_PASS) {
 setTimeout(continueToSetLineNumberHeights, 10);
 } else {
 alignerRunning = false;
 if (startOver) {
 startOver = false;
 setTimeout(setLineNumberHeights, 500);
 }
 }
 }
 function initLineNumberHeights() {
 // Do 2 complete passes, because there can be races
 // between this code and prettify.
 startOver = true;
 setTimeout(setLineNumberHeights, 250);
 window.onresize = setLineNumberHeights;
 }
 initLineNumberHeights();
</script>

 
 
 <div id="log">
 <div style="text-align:right">
 <a class="ifCollapse" href="#" onclick="_toggleMeta('', 'p', 'earth-api-samples', this)">Show details</a>
 <a class="ifExpand" href="#" onclick="_toggleMeta('', 'p', 'earth-api-samples', this)">Hide details</a>
 </div>
 <div class="ifExpand">
 
 <div class="pmeta_bubble_bg" style="border:1px solid white">
 <div class="round4"></div>
 <div class="round2"></div>
 <div class="round1"></div>
 <div class="box-inner">
 <div id="changelog">
 <p>Change log</p>
 <div>
 <a href="/p/earth-api-samples/source/detail?spec=svn121&amp;r=118">r118</a>
 by thatcher.ulrich
 on Oct 13, 2010
 &nbsp; <a href="/p/earth-api-samples/source/diff?spec=svn121&r=118&amp;format=side&amp;path=/trunk/demos/dom-tree/index.html&amp;old_path=/trunk/demos/dom-tree/index.html&amp;old=56">Diff</a>
 </div>
 <pre>Add an optional CGI arg &quot;kml&quot; that
automatically loads the specified KML
after initialization.
</pre>
 </div>
 
 
 
 
 
 
 <script type="text/javascript">
 var detail_url = '/p/earth-api-samples/source/detail?r=118&spec=svn121';
 var publish_url = '/p/earth-api-samples/source/detail?r=118&spec=svn121#publish';
 // describe the paths of this revision in javascript.
 var changed_paths = [];
 var changed_urls = [];
 
 changed_paths.push('/trunk/demos/dom-tree/index.html');
 changed_urls.push('/p/earth-api-samples/source/browse/trunk/demos/dom-tree/index.html?r\x3d118\x26spec\x3dsvn121');
 
 var selected_path = '/trunk/demos/dom-tree/index.html';
 
 
 function getCurrentPageIndex() {
 for (var i = 0; i < changed_paths.length; i++) {
 if (selected_path == changed_paths[i]) {
 return i;
 }
 }
 }
 function getNextPage() {
 var i = getCurrentPageIndex();
 if (i < changed_paths.length - 1) {
 return changed_urls[i + 1];
 }
 return null;
 }
 function getPreviousPage() {
 var i = getCurrentPageIndex();
 if (i > 0) {
 return changed_urls[i - 1];
 }
 return null;
 }
 function gotoNextPage() {
 var page = getNextPage();
 if (!page) {
 page = detail_url;
 }
 window.location = page;
 }
 function gotoPreviousPage() {
 var page = getPreviousPage();
 if (!page) {
 page = detail_url;
 }
 window.location = page;
 }
 function gotoDetailPage() {
 window.location = detail_url;
 }
 function gotoPublishPage() {
 window.location = publish_url;
 }
</script>

 
 <style type="text/css">
 #review_nav {
 border-top: 3px solid white;
 padding-top: 6px;
 margin-top: 1em;
 }
 #review_nav td {
 vertical-align: middle;
 }
 #review_nav select {
 margin: .5em 0;
 }
 </style>
 <div id="review_nav">
 <table><tr><td>Go to:&nbsp;</td><td>
 <select name="files_in_rev" onchange="window.location=this.value">
 
 <option value="/p/earth-api-samples/source/browse/trunk/demos/dom-tree/index.html?r=118&amp;spec=svn121"
 selected="selected"
 >/trunk/demos/dom-tree/index.html</option>
 
 </select>
 </td></tr></table>
 
 
 



 
 </div>
 
 
 </div>
 <div class="round1"></div>
 <div class="round2"></div>
 <div class="round4"></div>
 </div>
 <div class="pmeta_bubble_bg" style="border:1px solid white">
 <div class="round4"></div>
 <div class="round2"></div>
 <div class="round1"></div>
 <div class="box-inner">
 <div id="older_bubble">
 <p>Older revisions</p>
 
 
 <div class="closed" style="margin-bottom:3px;" >
 <img class="ifClosed" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/plus.gif" >
 <img class="ifOpened" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/minus.gif" >
 <a href="/p/earth-api-samples/source/detail?spec=svn121&r=56">r56</a>
 by api.roman.public
 on Feb 18, 2009
 &nbsp; <a href="/p/earth-api-samples/source/diff?spec=svn121&r=56&amp;format=side&amp;path=/trunk/demos/dom-tree/index.html&amp;old_path=/trunk/demos/dom-tree/index.html&amp;old=52">Diff</a>
 <br>
 <pre class="ifOpened">Fixed basic samples.. adding
setTimeout wrapper on alert() calls
inside callbacks and event handlers,
to prevent browser deadlocks.
</pre>
 </div>
 
 <div class="closed" style="margin-bottom:3px;" >
 <img class="ifClosed" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/plus.gif" >
 <img class="ifOpened" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/minus.gif" >
 <a href="/p/earth-api-samples/source/detail?spec=svn121&r=52">r52</a>
 by api.roman.public
 on Feb 10, 2009
 &nbsp; <a href="/p/earth-api-samples/source/diff?spec=svn121&r=52&amp;format=side&amp;path=/trunk/demos/dom-tree/index.html&amp;old_path=/trunk/demos/dom-tree/index.html&amp;old=51">Diff</a>
 <br>
 <pre class="ifOpened">Moved kmldomwalk.js and ge-poly-fit-
hack.js to lib/
</pre>
 </div>
 
 <div class="closed" style="margin-bottom:3px;" >
 <img class="ifClosed" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/plus.gif" >
 <img class="ifOpened" onclick="_toggleHidden(this)" src="http://www.gstatic.com/codesite/ph/images/minus.gif" >
 <a href="/p/earth-api-samples/source/detail?spec=svn121&r=51">r51</a>
 by api.roman.public
 on Feb 10, 2009
 &nbsp; <a href="/p/earth-api-samples/source/diff?spec=svn121&r=51&amp;format=side&amp;path=/trunk/demos/dom-tree/index.html&amp;old_path=/trunk/demos/dom-tree/index.html&amp;old=0">Diff</a>
 <br>
 <pre class="ifOpened">Added DOM tree (using DOM walker) demo
</pre>
 </div>
 
 
 <a href="/p/earth-api-samples/source/list?path=/trunk/demos/dom-tree/index.html&start=118">All revisions of this file</a>
 </div>
 </div>
 <div class="round1"></div>
 <div class="round2"></div>
 <div class="round4"></div>
 </div>
 <div class="pmeta_bubble_bg" style="border:1px solid white">
 <div class="round4"></div>
 <div class="round2"></div>
 <div class="round1"></div>
 <div class="box-inner">
 <div id="fileinfo_bubble">
 <p>File info</p>
 
 <div>Size: 8482 bytes,
 293 lines</div>
 
 <div><a href="//earth-api-samples.googlecode.com/svn/trunk/demos/dom-tree/index.html">View raw file</a></div>
 </div>
 
 <div id="props">
 <p>File properties</p>
 <dl>
 
 <dt>svn:mime-type</dt>
 <dd>text/html</dd>
 
 </dl>
 </div>
 
 </div>
 <div class="round1"></div>
 <div class="round2"></div>
 <div class="round4"></div>
 </div>
 </div>
 </div>


</div>

</div>
</div>

<script src="http://www.gstatic.com/codesite/ph/7955777679655757817/js/prettify/prettify.js"></script>
<script type="text/javascript">prettyPrint();</script>


<script src="http://www.gstatic.com/codesite/ph/7955777679655757817/js/source_file_scripts.js"></script>

 <script type="text/javascript" src="https://kibbles.googlecode.com/files/kibbles-1.3.3.comp.js"></script>
 <script type="text/javascript">
 var lastStop = null;
 var initialized = false;
 
 function updateCursor(next, prev) {
 if (prev && prev.element) {
 prev.element.className = 'cursor_stop cursor_hidden';
 }
 if (next && next.element) {
 next.element.className = 'cursor_stop cursor';
 lastStop = next.index;
 }
 }
 
 function pubRevealed(data) {
 updateCursorForCell(data.cellId, 'cursor_stop cursor_hidden');
 if (initialized) {
 reloadCursors();
 }
 }
 
 function draftRevealed(data) {
 updateCursorForCell(data.cellId, 'cursor_stop cursor_hidden');
 if (initialized) {
 reloadCursors();
 }
 }
 
 function draftDestroyed(data) {
 updateCursorForCell(data.cellId, 'nocursor');
 if (initialized) {
 reloadCursors();
 }
 }
 function reloadCursors() {
 kibbles.skipper.reset();
 loadCursors();
 if (lastStop != null) {
 kibbles.skipper.setCurrentStop(lastStop);
 }
 }
 // possibly the simplest way to insert any newly added comments
 // is to update the class of the corresponding cursor row,
 // then refresh the entire list of rows.
 function updateCursorForCell(cellId, className) {
 var cell = document.getElementById(cellId);
 // we have to go two rows back to find the cursor location
 var row = getPreviousElement(cell.parentNode);
 row.className = className;
 }
 // returns the previous element, ignores text nodes.
 function getPreviousElement(e) {
 var element = e.previousSibling;
 if (element.nodeType == 3) {
 element = element.previousSibling;
 }
 if (element && element.tagName) {
 return element;
 }
 }
 function loadCursors() {
 // register our elements with skipper
 var elements = CR_getElements('*', 'cursor_stop');
 var len = elements.length;
 for (var i = 0; i < len; i++) {
 var element = elements[i]; 
 element.className = 'cursor_stop cursor_hidden';
 kibbles.skipper.append(element);
 }
 }
 function toggleComments() {
 CR_toggleCommentDisplay();
 reloadCursors();
 }
 function keysOnLoadHandler() {
 // setup skipper
 kibbles.skipper.addStopListener(
 kibbles.skipper.LISTENER_TYPE.PRE, updateCursor);
 // Set the 'offset' option to return the middle of the client area
 // an option can be a static value, or a callback
 kibbles.skipper.setOption('padding_top', 50);
 // Set the 'offset' option to return the middle of the client area
 // an option can be a static value, or a callback
 kibbles.skipper.setOption('padding_bottom', 100);
 // Register our keys
 kibbles.skipper.addFwdKey("n");
 kibbles.skipper.addRevKey("p");
 kibbles.keys.addKeyPressListener(
 'u', function() { window.location = detail_url; });
 kibbles.keys.addKeyPressListener(
 'r', function() { window.location = detail_url + '#publish'; });
 
 kibbles.keys.addKeyPressListener('j', gotoNextPage);
 kibbles.keys.addKeyPressListener('k', gotoPreviousPage);
 
 
 }
 </script>
<script src="http://www.gstatic.com/codesite/ph/7955777679655757817/js/code_review_scripts.js"></script>
<script type="text/javascript">
 function showPublishInstructions() {
 var element = document.getElementById('review_instr');
 if (element) {
 element.className = 'opened';
 }
 }
 var codereviews;
 function revsOnLoadHandler() {
 // register our source container with the commenting code
 var paths = {'svn121': '/trunk/demos/dom-tree/index.html'}
 codereviews = CR_controller.setup(
 {"token":"dfc4e5b271ba67012ad3c69be7727c05","assetHostPath":"http://www.gstatic.com/codesite/ph","domainName":null,"assetVersionPath":"http://www.gstatic.com/codesite/ph/7955777679655757817","projectName":"earth-api-samples","projectHomeUrl":"/p/earth-api-samples","absoluteBaseUrl":"http://code.google.com","relativeBaseUrl":"","urlPrefix":"p","loggedInUserEmail":"luuisabelle@gmail.com"}, '', 'svn121', paths,
 CR_BrowseIntegrationFactory);
 
 codereviews.registerActivityListener(CR_ActivityType.REVEAL_DRAFT_PLATE, showPublishInstructions);
 
 codereviews.registerActivityListener(CR_ActivityType.REVEAL_PUB_PLATE, pubRevealed);
 codereviews.registerActivityListener(CR_ActivityType.REVEAL_DRAFT_PLATE, draftRevealed);
 codereviews.registerActivityListener(CR_ActivityType.DISCARD_DRAFT_COMMENT, draftDestroyed);
 
 
 
 
 
 
 
 var initialized = true;
 reloadCursors();
 }
 window.onload = function() {keysOnLoadHandler(); revsOnLoadHandler();};

</script>
<script type="text/javascript" src="http://www.gstatic.com/codesite/ph/7955777679655757817/js/dit_scripts.js"></script>

 
 
 
 <script type="text/javascript" src="http://www.gstatic.com/codesite/ph/7955777679655757817/js/ph_core.js"></script>
 
 
 
 
 <script type="text/javascript" src="/js/codesite_product_dictionary_ph.pack.04102009.js"></script>
</div> 
<div id="footer" dir="ltr">
 <div class="text">
 &copy;2011 Google -
 <a href="/projecthosting/terms.html">Terms</a> -
 <a href="http://www.google.com/privacy.html">Privacy</a> -
 <a href="/p/support/">Project Hosting Help</a>
 </div>
</div>
 <div class="hostedBy" style="margin-top: -20px;">
 <span style="vertical-align: top;">Powered by <a href="http://code.google.com/projecthosting/">Google Project Hosting</a></span>
 </div>
 
 


 
 </body>
</html>

